package cn.huaqingcheng.tool.data;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import jakarta.validation.constraints.Positive;

/**
 * 分页参数
 *
 * @author 清寒
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PageParam {

    /**
     * 页大小
     */
    @Positive
    private Integer size;

    /**
     * 页码
     */
    @Positive
    private Integer current;


    public <T> Page<T> toPage() {
        return new SimplePage<>(size, current);
    }

}
